package com.kefu.boss.vo;

import cn.hutool.core.bean.BeanUtil;
import com.kefu.boss.model.BossRole;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import com.kefu.sys.model.SysRole;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.util.List;

@Data
@ApiModel
public class BossRoleUpdateVo extends AbstractUpdateVo<BossRole,String> {
    @NotEmpty
    @ApiModelProperty(name = "id", value = "主键")
    private String roleId;

    @ApiModelProperty(name = "roleName", value = "角色名称")
    private String roleName;

    @ApiModelProperty(name = "roleDesc", value = "角色描述")
    private String roleDesc;

    @ApiModelProperty(name = "menuList", value = "权限")
    private List<String> menuList;
    @Override
    public BossRole convert() {
        BossRole info = BeanUtil.toBean(this, BossRole.class);
        info.setUpdateUser(KefuContext.getUid());
        info.setUpdateTime(KefuContext.getKefuContext().getNow());
        return info;
    }
}
